#pragma once
#include<vector>
#include<iostream>
using namespace std;
struct point
{
	int x;
	int y;
};
class snake
{
	vector<point>body;
	point direction;
	bool isgrow;
public:
	void Init();
	void move(vector<point>&f);
	bool checkPz();
	void grow();
	void draw();
	void setDirection(int dx,int dy);
	bool isOnSnake(point p)
	{
		for (const auto &segment : body)
		{
			if (segment.x == p.x && segment.y == p.y)
			{
				return true;
			}
		}
		return false;
	}
	point getHead();
};

